import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Test2 {
    private static List<List<Integer>> ret;
    private static List<Integer> path;
    private static int pathSum;
    private static int n;
    private static int m;
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            n = in.nextInt();
            m = in.nextInt();
            ret = new ArrayList<>();
            path = new ArrayList<>();
            dfs(0);
            ret.forEach(list -> {
                for (int i = 0; i < list.size(); i++) {
                    System.out.print(list.get(i));
                    if (i != list.size()-1) {
                        System.out.print(" ");
                    }
                }
                System.out.println();
            });
        }
    }

    private static void dfs (int num) {
        if (pathSum >= m) {
            if (pathSum == m) {
                ret.add(new ArrayList<>(path));
            }
            return;
        }
        for (int i = num+1; i <= n; i++) {
            pathSum += i;
            path.add(i);
            dfs(i);
            pathSum -= i;
            path.remove(path.size()-1);
        }
    }
}
